package com.hnust.controller;

import com.hnust.domain.TestList;
import com.hnust.service.TestListService;
import com.hnust.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin("*")
@RestController
@RequestMapping("/paper")
public class TestListController {

    @Autowired
    private TestListService testListService;

    @PostMapping("/getAllExam")
    public Result<List<TestList>> getAll(
            @RequestParam("teaId") String id,
            @RequestParam("status") int status,
            @RequestParam("pageNum") int pageNum,
            @RequestParam("pageSize") int pageSize
    ) {
//        System.out.println(id);
//        PageHelper.startPage(0,3);

        List<TestList> testLists= testListService.findById(id,status,pageNum,pageSize);
//
//        PageInfo<TestList> testListPageInfo = new PageInfo<>(testLists);
//        List<TestList> pageList = testListPageInfo.getList();
        return new Result<>(200,"成功查询",testLists);
    }

}
